import { Component, Input, OnInit } from '@angular/core'
import { NavState } from '../../common/const/nav-state.const'
import { AppJWTService } from '../../service/app-jwt.service'
import { AppRouterService } from '../../service/app-router.service'
import { AppStateService } from '../../service/app-state.service'

@Component({
  selector: 'AppHeader',
  templateUrl: './header.component.html',
  styleUrls: ['./header.component.less']
})
export class HeaderComponent implements OnInit {
  @Input() navState: string
  NavState: any = NavState

  pubs = [
    'asdasdasd',
    '222222222222',
    '444444444444444'
  ]
  constructor(public appRouterService: AppRouterService,
    private appStateService: AppStateService,
    private appJWTService: AppJWTService
  ) {
  }

  ngOnInit(): void {
    this.navState = this.navState ? this.navState : this.appStateService.navState
  }

  goHome() {
  }

  logout(): void {
    this.appJWTService.wipeToken()
    this.appRouterService.navigate(['login'])
  }


}

